<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="div">
        <!--v-show 和 v-if 的区别 
        v-show: 控制元素display属性,控制隐藏和显示
        v-if: 控制元素是否渲染,控制隐藏和显示 -->
        <div v-show="flag">这是show</div>
        <div v-if="flag">这是if</div>
    </div>
</body>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script>
    const app = new Vue({
        el: '#div',
        data: {
            flag: false
        },
    })
</script>

</html>